package ink.xiaobaibai.common;

/**
 * @description: 通用验证码
 * @author: 小白白
 * @create: 2021-05-13
 **/

public abstract class GeneralVerificationCode {

    /**
     * 设置验证码长度
     */
    protected static int codeLength = 4;

    /**
     * 验证码
     */
    protected String code;

    public String getCode() {
        return this.code;
    }

    public GeneralVerificationCode() {
        this.code = this.getRandomCode();
    }

    protected abstract String getRandomCode();

}
